package pc;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class demo4 {
    public static void main(String[] args) throws IOException {
        //properties是泛型，不用加类型
        Properties p = new Properties();
        p.put("aaa","bbb");
        p.put("ccc","ddd");
        p.put("eee","fff");

//        Set<Map.Entry<Object, Object>> entries = p.entrySet();
//        for (Map.Entry<Object, Object> entry : entries) {
//            Object key = entry.getKey();
//            Object value = entry.getValue();
//
//            System.out.println(key + "=" + value);
//        }
        //将这些文件写入
        BufferedWriter bw = new BufferedWriter(new FileWriter("D://cba.txt"));
        p.store(bw, "text");
        bw.close();

    }
}
